-
Couldn't load subscription status.
- Fork 13.9k
mbe: Rework the concat metavariable expression
#142975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
mbe: Rework the concat metavariable expression
#142975
Conversation
This comment has been minimized.
This comment has been minimized.
…ation, r=petrochenkov mbe: Add tests and restructure metavariable expressions Add tests that show better diagnostics, and factor `concat` handling to a separate function. Each commit message has further details. This performs the nonfunctional perparation for further changes such as rust-lang#142950 and rust-lang#142975 .
Rollup merge of #143245 - tgross35:metavariable-expr-organization, r=petrochenkov mbe: Add tests and restructure metavariable expressions Add tests that show better diagnostics, and factor `concat` handling to a separate function. Each commit message has further details. This performs the nonfunctional perparation for further changes such as #142950 and #142975 .
|
☔ The latest upstream changes (presumably #143267) made this pull request unmergeable. Please resolve the merge conflicts. |
b576c49 to
ada588e
Compare
Give a more user-friendly diagnostic about the following:
* Trailing tokens within braces, e.g. `${foo() extra}`
* Missing parentheses, e.g. `${foo}`
* Incorrect number of arguments, with a hint about correct usage.
Change to a structural diagnostic, update the valid list, and move the valid list to a note.
ada588e to
ebcfec9
Compare
The current messages have the potential to be more accurate; "expected identifier or string literal" is printed in a few cases where only an identifier should be expected, and it suggests removing string literals when that might not solve the problem. Add a new diagnostic for these kind of errors that gives more context and a better description. For `count` and `ignore` this should likely be combined with the diagnositcs for `eat_dollar` to produce a helpful error if they get anything other than a metavariable first argument. I am planning to do this in a followup.
* Now accept numbers, chars * Suffixes are stripped (needs more testing) * Report specific locations of errors * TODO: handle idents the same for expanded tokens
ebcfec9 to
0cd1695
Compare
0cd1695 to
e0fbd12
Compare
|
☔ The latest upstream changes (presumably #143721) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Reminder, once the PR becomes ready for a review, use |
#142950 plus followup
r? @ghost